﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace MacroprocesosWPF.Usuario
{
    /// <summary>
    /// Lógica de interacción para ContentPDFViewer.xaml
    /// </summary>
    public partial class ContentPDFViewer : UserControl
    {
        string filePath;

        public ContentPDFViewer()
        {
            InitializeComponent();
        }

        public ContentPDFViewer(string fileName) : this()
        {
            filePath = fileName;
        }

        private void UserControl_Loaded_1(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(filePath))
            {
                var pdfView = new PDFViewer(filePath);
                this.formHostContainer.Child = pdfView;
            }
        }
    }
}
